SET NOCOUNT ON
GO

IF OBJECT_ID('Test_') IS NOT NULL DROP PROCEDURE Test_
IF OBJECT_ID('Test_ME') IS NOT NULL DROP PROCEDURE Test_ME
IF OBJECT_ID('Test_DEFAULT') IS NOT NULL DROP PROCEDURE Test_DEFAULT
GO

CREATE PROCEDURE Test_ @DelegateName varchar(50)
AS
BEGIN
	RETURN NULL
END
GO

CREATE PROCEDURE Test_ME
AS
BEGIN
	PRINT 'this is interface test_ called by @DelegateName ME '
END
GO

CREATE PROCEDURE Test_DEFAULT
AS
BEGIN
	PRINT 'this is the default delegate for interface test_ '
END
GO

-- Compile
exec qic.Compile

-- Run
exec Test_'ME'
exec Test_'YOU'

PRINT '--'
PRINT 'The generated interface'
PRINT '--'
exec qic.ScriptInterface 'Test_'
PRINT '--'

GO

IF OBJECT_ID('Test_') IS NOT NULL DROP PROCEDURE Test_
IF OBJECT_ID('Test_ME') IS NOT NULL DROP PROCEDURE Test_ME
IF OBJECT_ID('Test_DEFAULT') IS NOT NULL DROP PROCEDURE Test_DEFAULT
GO
